<!--
 * @Author: WuFeng <763467339@qq.com>
 * @Date: 2022-06-14 15:49:29
 * @LastEditTime: 2022-12-02 17:32:40
 * @LastEditors: WuFeng <763467339@qq.com>
 * @Description:
 * @FilePath: \vue3-element-plus-web\src\views\FormDesignDemo\index.vue
 * Copyright 版权声明
-->
<template>
  <div class="app-container">
    <avue-form-design
      style="height: 100vh;"
      :options="options"
      @submit="handleSubmit"
      :custom-fields="customFields">
    </avue-form-design>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Test',
  components: {
  },
  computed: {
    ...mapGetters([
      'token'
    ])
  },
  data() {
    return {
      customFields: [
        {
          title: '分割线',
          component: 'el-divider', //ele分割线
          span: 24,
          icon: 'el-icon-eleme',
          tips: '看我：自定义属性怎么用？',
          labelWidth: '0px',
          params: {
            html: '<h3 style="color:red">分割线标题</h3>',
            contentPosition: 'left'
          }
        },
        {
          title: '警告',
          component: 'el-alert',
          labelWidth: '0px',
          span: 24,
          icon: 'el-icon-warning',
          tips: '看我：自定义事件怎么用？',
          params: {
            title: '警告警告警告警告',
            type: 'success'
          },
          event: {
            close: () => {
              console.log('alert关闭事件')
            }
          }
        }
      ],
      options: {
      }
    }
  },
  watch: {
  },
  created() {
  },
  activated() {
  },
  deactivated() {
  },
  methods: {
    handleSubmit(val) {
      this.$message.success('查看控制台')
      console.log(val)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.app-container {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  min-height: 100%;
  height: 100%;
  :deep iframe[title="GitHub"] {
    display: none;
  }
}
</style>
